package com.hzit.manager.controller;

import com.hzit.anno.RequirePermissions;
import com.hzit.manager.client.UserClient;
import com.hzit.manager.service.IStudentService;
import com.hzit.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wf
 * @since 2024-02-28
 */
@RestController
@RequestMapping("/student")
public class StudentController {
	@Autowired
	private IStudentService studentService;
	@Autowired
	private UserClient userClient;
	//1. 列表学生
	@GetMapping("/list")
	@RequirePermissions("student:tolist123")
	public R findAll(){
		return R.ok(studentService.list());
	}

	//2. 读取用户列表
	@GetMapping("/userlist")
	public R findUsers(){
		R r = userClient.list();
		return r;
	}
}
